<?php

class ChangeStatusValueController extends ControllerBackend
{
	public function actionIndex()
	{
		//var_dump($_POST);
        //echo Yii::app()->createUrl("global/changeStatusValue/index", array("abc"=>1, "test" => 2));
        if (Yii::app()->request->isPostRequest) {
            $modelName = Yii::app()->request->getPost('model');
            $id = intval(Yii::app()->request->getPost('id'));
            $column = Yii::app()->request->getPost('column');
            $value = intval(Yii::app()->request->getPost('value'));
            
            /*
            $model = new $modelName;
//            $model = CActiveRecord::model($modelName);
            $model::model()->updateByPk($id, array($column => $value));
            
            echo letFunction::statusLink("KitNewsArticle", "active", $model->id, $model->active);
            */
            
            echo letFunction::statusLink("KitNewsArticle", "active", $id, $value);
        }
        
	}
}